import e


class AppScreenshot:  # 类名规则：App+文件名，文件名首字母大写，如temp.py，类名一定要为AppTemp
    def priority(self):  # 该插件在你的plugin的app目录里的触发优先级
        return 3

    def should_trigger(self, message, event):
        result = False  # 初始化结果变量
        if hasattr(message, 'content'):
            if not message.content is None:
                result = (message.content.startswith("截图") or message.content.startswith("本地截图")) and event == 0
            else:
                result = False and event == 0
        return result

    async def execute(self, message, api, event):
        url = message.content.replace("本地截图", "", 1).replace("截图", "", 1)  # 请替换为具体的消息内容
        await e.screenshot(api, message, url)
        return True
